/*
 * Case.h
 *
 *	This class represents a case on Case based engine
 *
 *	A case has an attribute set, an action set and a result set. Those attributes
 *	are used by Evolutive Algorithm to generate more adapted cases.
 *
 *  Created on: 29/05/2011
 *      Author: godinho
 */

#ifndef CASE_H_
#define CASE_H_

#include <evolutive/Dna.h>

/*
 * TODO document it
 *
 * TODO remove references to Dna classe, since this class are accessed through
 * python interpreter.
 */
class Case {
public:
	Case();
	virtual ~Case();

	/*
	 * Getters and setters
	 *
	 * TODO refactoring - use enums
	 */
    unsigned char getLocalGreenExtension() const;

    unsigned char getLocalQueue() const;

    unsigned char getLocalSideQueue() const;

    unsigned char getLocalSideTime() const;

    unsigned char getLocalTime() const;

    unsigned char getNextGreenExtension() const;

    unsigned char getNextQueue() const;

    unsigned char getNextSideGreenExtension() const;

    unsigned char getNextSideQueue() const;

    unsigned char getNextSideTime() const;

    unsigned char getNextTime() const;

    unsigned char getPrefiousQueue() const;

    unsigned char getPreviousGreenExtension() const;

    unsigned char getPreviousSideGreenExtension() const;

    unsigned char getPreviousSideQueue() const;

    unsigned char getPreviousSideTime() const;

    unsigned char getPreviousTime() const;

    unsigned char getResultLocalQueue() const;

    unsigned char getResultLocalSideQueue() const;

    unsigned char getResultNextQueue() const;

    unsigned char getResultNextSideQueue() const;

    unsigned char getResultPreviousQueue() const;

    float getFitness() const;

    float getSimilarity();

    int getId();

    Dna* getDna();

    void setLocalGreenExtension(unsigned char mLocalGreenExtension);

    void setLocalQueue(unsigned char mLocalQueue);

    void setLocalSideQueue(unsigned char mLocalSideQueue);

    void setLocalSideTime(unsigned char mLocalSideTime);

    void setLocalTime(unsigned char mLocalTime);

    void setNextGreenExtension(unsigned char mNextGreenExtension);

    void setNextQueue(unsigned char mNextQueue);

    void setNextSideGreenExtension(unsigned char mNextSideGreenExtension);

    void setNextSideQueue(unsigned char mNextSideQueue);

    void setNextSideTime(unsigned char mNextSideTime);

    void setNextTime(unsigned char mNextTime);

    void setPrefiousQueue(unsigned char mPrefiousQueue);

    void setPreviousGreenExtension(unsigned char mPreviousGreenExtension);

    void setPreviousSideGreenExtension(unsigned char mPreviousSideGreenExtension);

    void setPreviousSideQueue(unsigned char mPreviousSideQueue);

    void setPreviousSideTime(unsigned char mPreviousSideTime);

    void setPreviousTime(unsigned char mPreviousTime);

    void setResultLocalQueue(unsigned char mResultLocalQueue);

    void setResultLocalSideQueue(unsigned char mResultLocalSideQueue);

    void setResultNextQueue(unsigned char mResultNextQueue);

    void setResultNextSideQueue(unsigned char mResultNextSideQueue);

    void setResultPreviousQueue(unsigned char mResultPreviousQueue);

    void setFitness(float f);

    void setSimilarity(float f);

    void setId(int id);

    void setDna(Dna* dna);

    void reset();

private:

    float mFitness;

    float mSimilarity;

    int mId;

    Dna* mDna;

	/*
	 * Case attributes
	 */
	unsigned char mLocalQueue;
	unsigned char mLocalSideQueue;
	unsigned char mNextQueue;
	unsigned char mNextSideQueue;
	unsigned char mPrefiousQueue;
	unsigned char mPreviousSideQueue;
	unsigned char mLocalTime;
	unsigned char mLocalSideTime;
	unsigned char mNextTime;
	unsigned char mNextSideTime;
	unsigned char mPreviousTime;
	unsigned char mPreviousSideTime;

	/*
	 * Case actions
	 */
	unsigned char mLocalGreenExtension;
	unsigned char mNextGreenExtension;
	unsigned char mNextSideGreenExtension;
	unsigned char mPreviousGreenExtension;
	unsigned char mPreviousSideGreenExtension;

	/*
	 * Case results
	 */
	unsigned char mResultLocalQueue;
	unsigned char mResultLocalSideQueue;
	unsigned char mResultNextQueue;
	unsigned char mResultNextSideQueue;
	unsigned char mResultPreviousQueue;
};


#endif /* CASE_H_ */
